<!--
 * @Author: your name
 * @Date: 2022-01-04 09:52:13
 * @LastEditTime: 2022-01-19 11:02:58
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \central-system\src\modules\SystemDemo\Redirect\index.vue
-->
<template>
  <div v-loading="loading" />
</template>
<script>
import { getInfoByToken } from './api.js'
export default {
  name: 'Internal',
  data() {
    return {
      loading: true,
      access_token: ''
    }
  },
  async created() {
    if (this.$route.query.token) {
      this.access_token = this.$route.query.token
      this.$storage.set('access_token', this.access_token)
      await getInfoByToken(this.access_token)
        .then((res) => {
          this.$storage.set('username', res.userName)
        })
        .catch(() => {})
      this.redirectTo()
    }
  }
}
</script>
<style lang="scss" scoped>
</style>